home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / perl419x.zip / README.MSD < prev    next >
Text File  |  1992-02-23  |  10KB  |  263 lines

  1.                       Notes on MS-DOS Perl
  2.                 Len Reed <holos0!lbr@gatech.edu>
  3.                          September, 1991
  4.  
  5.  
  6. Note: the documentation relating to using MS-DOS perl has been
  7. incorporated into the main manual.  See the section below on the
  8. manual.
  9.  
  10. Copying
  11. -------
  12. MS-DOS perl may be distributed under the terms of the Gnu public
  13. license or the artistic license.  You should have received copies
  14. of the files License and Artistic.
  15.  
  16.  
  17. Warranty
  18. --------
  19. This is free software.  It comes with no warranty of any kind.
  20.  
  21.  
  22. Obtaining the Source Code
  23. -------------------------
  24.  
  25. The standard perl source may be obtained from numerous public
  26. archive sources, and is available for anonymous ftp from
  27. <jpl-devvax.Jpl.Nasa.Gov>.  The MS-DOS changes incorporated into
  28. this version are not yet publically available, but should be
  29. soon.
  30.  
  31. Carriage-Return/Line-feed Fixup
  32. -------------------------------
  33. This package has been back and forth from Unix to MS-DOS many
  34. times.  If your MS-DOS text files, e.g., a manual or batch file,
  35. are missing the carriage returns, the following will insert them:
  36.  
  37. a    perl -i.bak -pe ";" file [file ...]
  38.  
  39. The ";" is a null perl script, the fixup is accomplished by
  40. reading a text file (which converts CR/LF ==> LF but passes LFs
  41. unmolested) and writing it (which converts LF==>CR/LF).
  42.  
  43.  
  44. Functionality
  45. -------------
  46. Several standard perl commands are not supported by MS-DOS perl
  47. for this simple reason that MS-DOS does not support many basic
  48. Unix functions like fork(), pipe(), and wait().  Use of these
  49. functions and many other like them will result in a fatal error. 
  50. See the manual for details.  All text processing features are
  51. intact.
  52.  
  53. The other limiting factor in using MS-DOS perl is memory.  The
  54. executable takes over 300 K-bytes before it starts calling
  55. malloc().  And it loves to call malloc().  You'll need 640K.  An
  56. 80286 with MS-DOS 5.0 running in high memory will help.  If you
  57. have an 80386 perl will find and use "upper memory" if available. 
  58. (Refer to Microsoft's documentation on XMS and MS-DOS 5.0.)
  59.  
  60. Subprocesses are always run to completion, since MS-DOS doesn't
  61. support multi-tasking.  Pipes are emulated by using temporary
  62. files.  MS-DOS perl can swap itself to disk (ideally a RAM disk
  63. in extended or expanded memory) so that the subprocess has space
  64. to run.
  65.  
  66. MS-DOS perl is compatible with the MKS toolkit: it can pass and
  67. receive extended argument lists to/from MKS tools.
  68.  
  69. To read and write binary files, use the binmode command.  (See
  70. the manual.)
  71.  
  72. The chdir function has been enhanced to allow changing the drive
  73. and/or the directory.
  74.  
  75. The Gnu version of dbm (gdbm) has been added to MS-DOS perl.
  76.  
  77. The perl debugger works as described in the manual, but it takes
  78. a lot of memory, so you won't be able to use it to debug any
  79. complicated.  (Bit of a Catch-22, I'm afraid.)
  80.  
  81.  
  82. Things To Do
  83. ------------
  84. The globbing for non-MKS users is pretty bad: the Microsoft
  85. globbing routines are used, and they're pretty primitive.
  86.  
  87. Some users have expressed an interest in 4DOS argument-passing
  88. compatibility.
  89.  
  90. Network communication (sockets) is not implemented.  There's a
  91. need for a freely distributable sockets library that works with a
  92. variety of network cards.
  93.  
  94. The exec() function is poorly implemented.  Without forks it's
  95. not too useful, and hence the considerable work required to make
  96. it function properly has been repeatedly put off.
  97.  
  98. MS-DOS perl takes too much memory.  There's a lot of code that
  99. doesn't do anything useful under MS-DOS but that is nevertheless
  100. compiled in.
  101.  
  102. I'm convinced that the exec-swapping code is not general enough
  103. for the worst case.  (That code was adapted from Dennis Vadura's
  104. dmake program.)  There may also be some memory leakage due to
  105. bugs in Microsoft's malloc library code.
  106.  
  107. For the truly ambitious, perl could be ported to gcc for i386 MS-
  108. DOS.  It could then run in 32-bit mode with large amounts of
  109. memory.  That would be a big project and really should use this
  110. port only as a basepoint: it should remain separate.  Any
  111. takers? :-)
  112.  
  113. See also Wishlist.dds.
  114.  
  115.  
  116. The Perl Manual
  117. ---------------
  118. If you got this file as part of the complete perl source
  119. distribution, you can make one of three manuals from the n/troff
  120. manual source: the standard Unix manual, an MS-DOS manual, or a
  121. combined Unix/MS-DOS manual.  Near the top of that file there's a
  122. string register that gets set to 'unix', 'msdos', or 'both'.  The
  123. 'unix' version has little mention of MS-DOS, the 'both' version
  124. includes additional commentary on MS-DOS and a section on "MS-DOS
  125. Considerations."  The 'msdos' version omits large sections of the
  126. standard manual that are not relevant to MS-DOS: every command is
  127. mentioned, but many simply note that they are not supported on
  128. MS-DOS.
  129.  
  130. If you got this file as part of an MS-DOS executable kit, you
  131. should have received a formatted manual in that kit: perldos.man.
  132. This manual contains simple highlighting in the form of boldface
  133. and underlining accomplished by backspacing.  There is a one-line
  134. script in the eg directory (nohigh.bat) that will remove the
  135. highlighting.
  136.  
  137.      perl -p eg/nohigh.bat perldos.man > perldos.van
  138.  
  139. This will create perldos.van without highlighting.
  140.  
  141. Only the perl.exe file is needed for this script; it doesn't
  142. require a full installation of perl.
  143.  
  144. The versions of the manual that include MS-DOS commentary are not
  145. major re-writes; many of the examples have Unixisms that won't
  146. work on MS-DOS without some changes.
  147.  
  148. Beware that the "Camel" book, the only text on perl, barely
  149. mentions MS-DOS.  Nevertheless, this book should prove useful to
  150. the MS-DOS perl programmer.
  151.  
  152.  
  153. Installing MS-DOS Perl
  154. ----------------------
  155. Put perl.exe into a directory in your PATH.  Put perlglob.exe
  156. into that directory, too.  (Not needed for MKS users.)  If you
  157. wish to use the -P switch, copy doscpp.pl to a library directory. 
  158. (If you don't have Microsoft C 6.0 you'll have to edit this
  159. file.)  If you want to use the perl debugger, copy perldb.pl to
  160. the library directory, too.  Set up your environment as explained
  161. in the manual.
  162.  
  163. Building MS-DOS Perl from the Source
  164. ------------------------------------
  165. Apply the patches to the standard 4.019 source.
  166.  
  167. This code will compile only on Microsoft C, 5.0, 5.1, or 6.0. 
  168. The last of these produces the best code.  (It may be possible to
  169. cross-compile from SCO Xenix or Unix, since these cross-compilers
  170. are close relatives of the Microsoft compilers.)  The makefile is
  171. specific to Dennis Vadura's dmake program; if you don't have
  172. this, get it.  (See the makefile for the ftp address.)  There are
  173. batch files build5.bat and build6.bat to build perl.exe with
  174. Microsoft C 5.x and 6.0, respectively, if you don't have dmake.
  175.  
  176. If you wish to include gdbm, you'll have to obtain it.  Be sure
  177. to get the MS-DOS version.  I used version 1.4, with MS-DOS
  178. patches by Thorsten Ohl <td12@@ddagsi3.bitnet>.  Build the
  179. library (LGDBM.LIB) and copy it to the directory with the
  180. compiler libraries.  Copy the files "ndbm.h" and "gdbmdefs.h" to
  181. the compiler include file directory.  Enable the GDBM option in
  182. the makefile or edit the batch script or the config.h file to
  183. define HAS_NDBM.  Do not copy any other gdbm header files: in
  184. particular, "extern.h" will conflict with perl's extern.h.
  185.  
  186. Don't run Configure for MS-DOS: a pre-made config.h file is found
  187. in the msdos subdirectory.
  188.  
  189. Edit the makefile at the top to select the options you need.  (Or
  190. edit the batch file, using the makefile as a guide.)  The
  191. makefile will attempt to run BISON to create perly.c and perly.h
  192. from perly.y.  You can instead import your Unix-made version of
  193. these files.  (These are independent of platform, so you don't
  194. need to do anything to the Unix versions.  If using Unix yacc, be
  195. sure to copy over the version that had perlyfixer.sh run against
  196. it.)
  197.  
  198. Build perl.exe in the msdos subdirectory.
  199.  
  200. You'll need free XMS memory to run the Microsoft Codeview
  201. debugger on perl.
  202.  
  203.  
  204. Running the Test Suite
  205. ----------------------
  206. This section applies only if you're building MS-DOS perl from the
  207. source.  The test suite has been altered to run under MS-DOS. 
  208. Tests that aren't relevant under MS-DOS are if'ed around, so all
  209. tests should pass.  You'll need a lot of Unix-like tools (e.g.,
  210. rm); I used the MKS toolkit.  Copy perl.exe into the "t"
  211. directory.  Set up the environment and install doscpp.pl.
  212.  
  213.  
  214. You can't just run "perl test" since you'll run out of memory. 
  215. Try running each directory of tests, e.g.,
  216.     ./perl test base/*.t"
  217.  
  218. It may be necessary to break this even finer, some of the
  219. directories have a lot of tests.
  220.  
  221.  
  222. History of MS-DOS Perl
  223. ----------------------
  224. Larry Wall wrote perl, and continues to enhance it.  While he has
  225. done no direct work on MS-DOS perl, most of the code in MS-DOS
  226. perl is his since most of the code concerns portable features.
  227.  
  228. Perl was originally ported to MS-DOS by Diomidis Spinellis.  His
  229. code was distributed with version 3, patch level 18 (3.018). 
  230. This was in April, 1990.
  231.  
  232. Len Reed's executable version based upon 3.041 source with
  233. considerable enhancements was posted to USENET
  234. comp.binaries.ibm.pc in November, 1990.  This version included
  235. considerable minor bug fixes, swapping to disk while running
  236. subprocesses, "smarter" subprocesses (i.e., don't use COMMAND.COM
  237. if you don't need it), MKS toolkit compatibility, support for
  238. the -P switch, enhanced chdir semantics, and enhanced support for
  239. the -i switch.  (The last two of these due to Tom Dinger.)
  240.  
  241. Tom Dinger cleaned up the released MS-DOS source code after perl
  242. 4.x came out.  By 4.010, he had put the following into the
  243. standard sources: enhanced chdir, enhanced -i support, several
  244. bug fixes.  He also created the msdos/config.h file.
  245.  
  246. In September 1991, I (Len Reed) added the functions that were in
  247. my 3.041 version that hadn't been incorporated into the standard
  248. 4.010 source: notably swapping, smarter subprocesses, support
  249. for -P, and MKS compatibility.  I fixed some minor bugs.  I added
  250. gdbm support.  I altered the test suite to work with MS-DOS.  I
  251. put MS-DOS support into the main manual and reworked the other
  252. documentation, including this file.
  253.  
  254.  
  255. The Authors
  256. -----------
  257. Larry Wall         <lwall@netlabs.com>
  258. Diomidis Spinellis <dds@cc.ic.ac.uk>
  259. Len Reed           <holos0!lbr@gatech.edu>
  260. Tom Dinger         <tdinger@East.Sun.Com>
  261.  
  262. The address for Diomidis Spinellis may be out of date.
  263.